
<%@ page import="playitas.Playas" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'playas.label', default: 'Playas')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'playas.id.label', default: 'Id')}" />
                        
                            <g:sortableColumn property="distancia" title="${message(code: 'playas.distancia.label', default: 'Distancia')}" />

                            <g:sortableColumn property="accMinusvalidos" title="${message(code: 'playas.accMinusvalidos.label', default: 'Acc Minusvalidos')}" />
                        
                            <g:sortableColumn property="caracteristicas" title="${message(code: 'playas.caracteristicas.label', default: 'Caracteristicas')}" />
                        
                            <g:sortableColumn property="chiringuito" title="${message(code: 'playas.chiringuito.label', default: 'Chiringuito')}" />
                        
                            <g:sortableColumn property="latitud" title="${message(code: 'playas.latitud.label', default: 'Latitud')}" />
                        
                            <g:sortableColumn property="longitud" title="${message(code: 'playas.longitud.label', default: 'Longitud')}" />
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:set var="tituloDistancia" value="${new Integer(100)}"/>
                    <g:each in="${playasInstanceList}" status="i" var="playasInstance">
                        <g:if test="${playasInstance.distancia < tituloDistancia }">
                          <tr class="titulo_distancia" >
                              <td colspan="7">A menos de ${tituloDistancia} metros</td>
                          </tr>
                          <g:set var="tituloDistancia" value="${tituloDistancia*10}"/>
                        </g:if>


                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${playasInstance.id}">${fieldValue(bean: playasInstance, field: "id")}</g:link></td>

                            <td>${fieldValue(bean: playasInstance, field: "distancia")}</td>

                            <td><g:formatBoolean boolean="${playasInstance.accMinusvalidos}" /></td>
                        
                            <td>${fieldValue(bean: playasInstance, field: "caracteristicas")}</td>
                        
                            <td><g:formatBoolean boolean="${playasInstance.chiringuito}" /></td>
                        
                            <td>${fieldValue(bean: playasInstance, field: "latitud")}</td>
                        
                            <td>${fieldValue(bean: playasInstance, field: "longitud")}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${playasInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
